<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- 生产环境版本，优化了尺寸和速度 -->
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <!-- 引入样式 -->
    <link
            rel="stylesheet"
            href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"
    />
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <title>后台管理-登录</title>
    <link rel="stylesheet" href="./css/backend.css" />
<!--    <script src="./js/ui-index.js"></script>-->
<!--    <script src="/js/vue.js"></script>-->
<!--    <link rel="stylesheet" href="/js/vue-index.css">-->
</head>
<body>
<div id="app">
    <el-row class="tac">
        <el-col :span="12">
            <h2 style="margin-left: 30px">后台管理</h2>
            <el-menu
                    default-active="1"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose"
            >
                <el-menu-item @click="change(1)" index="1">
                    <i class="el-icon-menu"></i>
                    <span slot="title">用户管理</span>
                </el-menu-item>
                <el-menu-item @click="change(2)" index="2">
                    <i class="el-icon-menu"></i>
                    <span slot="title">设备管理</span>
                </el-menu-item>
                <el-menu-item @click="change(3)" index="3">
                    <i class="el-icon-document"></i>
                    <span slot="title">订单管理</span>
                </el-menu-item>
            </el-menu>
        </el-col>
        <div class="content-box">
            <div v-if="currentIndex===1"style="position: relative" class="content user">
                <el-dialog
                        title="编辑"
                        :visible.sync="dialogVisible"
                        width="30%"
                        :before-close="handleClose"
                >
                    <el-form label-position="left" label-width="80px" >
                        <el-form-item label="用户名">
                            <el-input v-model="userMod.loginName"></el-input>
                        </el-form-item>
                        <!--                            <el-form-item label="设备状态">-->
                        <!--                                <el-input v-model="equipmentForm.status"></el-input>-->
                        <!--                            </el-form-item>-->
                        <el-form-item label="性别">
                            <el-input v-model="userMod.sex"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号">
                            <el-input v-model="userMod.mobile"></el-input>
                        </el-form-item>

                    <el-form-item label="校园卡">
                        <el-input v-model="userMod.campusCard"></el-input>
                    </el-form-item>
                        <el-form-item label="学校">
                            <el-input v-model="userMod.school"></el-input>
                        </el-form-item>

                    </el-form>
                    <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitMod"
                >确 定</el-button
                >
              </span>
                </el-dialog>
                <div class="table">
                    <div class="title">
                        <span>序号</span>
                        <span>用户名</span>
                        <span>性别</span>
                        <span>手机号</span>
                        <span>校园卡号</span>
                        <span>学校</span>
                        <span>积分</span>
                        <span>余额</span>
                        <span>操作</span>
                    </div>
                    <div v-for="(item,index) in userList" class="tab-con">
                        <span>{{index+1}}</span>
                        <span>{{item.loginName}}</span>
                        <span>{{item.sex}}</span>
                        <span>{{item.mobile}}</span>
                        <span>{{item.campusCard}}</span>
                        <span>{{item.school}}</span>
                        <span>{{item.integral}}</span>
                        <span>{{item.amount}}</span>
                        <div>
                            <el-button @click="modify(index)" type="primary"
                            >编辑</el-button
                            >

                            <el-button @click="remove(userList,index)" type="danger"
                            >删除</el-button
                            >
                        </div>
                    </div>
                </div>
                <div style="margin: 50px auto;position: absolute;right: 20px" class="page">

                    <el-pagination background layout="prev, pager, next" :total="total" :current-page="userParams.pagination" :page-size="userParams.PageSize" @current-change="pageChange">
                    </el-pagination>
                </div>
            </div>
            <div v-if="currentIndex===2" class="content user">
                <div style="margin:30px" class="add">
                    <el-button  @click=" addVisible = true" type="primary">添加设备</el-button>
<!--                    <el-button @click="type('all')" type="warning">全部</el-button>-->
<!--                    <el-button @click="type('male')" type="warning">男浴室</el-button>-->
<!--                    <el-button @click="type('female')" type="danger">女浴室</el-button>-->
                    <el-dialog
                            title="添加"
                            :visible.sync=" addVisible"
                            width="30%"
                            :before-close="handleClose"
                    >
                        <el-form label-position="left" label-width="80px" >
                            <el-form-item label="设备编号">
                                <el-input v-model="equipmentForm.index"></el-input>
                            </el-form-item>
<!--                            <el-form-item label="设备状态">-->
<!--                                <el-input v-model="equipmentForm.status"></el-input>-->
<!--                            </el-form-item>-->
                            <el-form-item label="设备归属">
                                <el-input v-model="equipmentForm.location"></el-input>
                            </el-form-item>
                        </el-form>
                        <span slot="footer" class="dialog-footer">
                <el-button @click=" addVisible = false">取 消</el-button>
                <el-button type="primary" @click=" addEquipment"
                >确 定</el-button
                >
              </span>
                    </el-dialog>
                </div>
                <el-dialog
                        title="编辑"
                        :visible.sync="dialogVisible"
                        width="30%"
                        :before-close="handleClose"
                >
                    <el-form label-position="left" label-width="80px" >
                        <el-form-item label="编号">
                            <el-input v-model="equipmentMod.index"></el-input>
                        </el-form-item>
                        <!--                            <el-form-item label="设备状态">-->
                        <!--                                <el-input v-model="equipmentForm.status"></el-input>-->
                        <!--                            </el-form-item>-->
                        <el-form-item label="归属">
                            <el-input v-model="equipmentMod.location"></el-input>
                        </el-form-item>


                    </el-form>
                    <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitMod"
                >确 定</el-button
                >
              </span>
                </el-dialog>

                <el-tabs v-model="equactiveName" @tab-click="handleClick">
                    <el-tab-pane label="全部" name="eq-first">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in equipmentList" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="男浴室" name="eq-six">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in maleEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="女浴室" name="eq-seven">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in femaleEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="使用中" name="eq-second">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in DoingEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="未使用" name="eq-third">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in NOT_USEEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="已预约" name="eq-fourth">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in PreEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="故障" name="eq-fifth">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>设备id</span>
                                <span>设备编号</span>
                                <span>归属</span>

                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in ErrorEquipment" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.index}}</span>
                                <span>{{item.location}}</span>

                                <div>
                                    <el-button @click="modify(index)" type="primary"
                                    >编辑</el-button
                                    >

                                    <el-button @click="remove(equipmentList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                </el-tabs>

                <div style="margin: 50px auto;position: absolute;right: 20px" class="page">

                    <el-pagination  background layout="prev, pager, next" :total="total" :current-page="equipmentParams.pagination" :page-size="equipmentParams.PageSize" @current-change="EpageChange">
                    </el-pagination>
                </div>
            </div>
            <div v-if="currentIndex===3" class="content user">
                <el-dialog
                        title="编辑"
                        :visible.sync="dialogVisible"
                        width="30%"
                        :before-close="handleClose"
                >
                    <el-form label-position="left" label-width="80px" >
                        <el-form-item label="编号">
                            <el-input v-model="equipmentMod.index"></el-input>
                        </el-form-item>
                        <!--                            <el-form-item label="设备状态">-->
                        <!--                                <el-input v-model="equipmentForm.status"></el-input>-->
                        <!--                            </el-form-item>-->
                        <el-form-item label="归属">
                            <el-input v-model="equipmentMod.location"></el-input>
                        </el-form-item>


                    </el-form>
                    <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitMod"
                >确 定</el-button
                >
              </span>
                </el-dialog>

                <el-tabs v-model="activeName" @tab-click="handleClick">
                    <el-tab-pane label="全部" name="first">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>订单编号</span>
                                <span>用户</span>
                                <span>创建时间</span>
                                <span>结束时间</span>
                                <span>金额</span>
                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in recordList" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.user.loginName}}</span>
                                <span>{{item.gmtCreated}}</span>
                                <span>{{item.endTime}}</span>
                                <span>{{item.amount+"元"}}</span>
                                <div>
                                    <el-button @click="remove(recordList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="使用中" name="second">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>订单编号</span>
                                <span>用户</span>
                                <span>创建时间</span>
                                <span>结束时间</span>
                                <span>金额</span>
                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in DoingRecord" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.user.loginName}}</span>
                                <span>{{item.gmtCreated}}</span>
                                <span>{{item.endTime}}</span>
                                <span>{{item.amount+"元"}}</span>
                                <div>
                                    <el-button @click="remove(recordList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="已完成" name="third">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>订单编号</span>
                                <span>用户</span>
                                <span>创建时间</span>
                                <span>结束时间</span>
                                <span>金额</span>
                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in DoneRecord" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.user.loginName}}</span>
                                <span>{{item.gmtCreated}}</span>
                                <span>{{item.endTime}}</span>
                                <span>{{item.amount+"元"}}</span>
                                <div>
                                    <el-button @click="remove(recordList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="故障" name="fourth">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>订单编号</span>
                                <span>用户</span>
                                <span>创建时间</span>
                                <span>结束时间</span>
                                <span>金额</span>
                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in ErrorRecord" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.user.loginName}}</span>
                                <span>{{item.gmtCreated}}</span>
                                <span>{{item.endTime}}</span>
                                <span>{{item.amount+"元"}}</span>
                                <div>
                                    <el-button @click="remove(recordList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="取消" name="fifth">
                        <div class="table">
                            <div class="title">
                                <span>序号</span>
                                <span>订单编号</span>
                                <span>用户</span>
                                <span>创建时间</span>
                                <span>结束时间</span>
                                <span>金额</span>
                                <span>操作</span>
                            </div>
                            <div v-for="(item,index) in CancelRecord" class="tab-con">
                                <span>{{index+1}}</span>
                                <span>{{item.id}}</span>
                                <span>{{item.user.loginName}}</span>
                                <span>{{item.gmtCreated}}</span>
                                <span>{{item.endTime}}</span>
                                <span>{{item.amount+"元"}}</span>
                                <div>
                                    <el-button @click="remove(recordList,index)" type="danger"
                                    >删除</el-button
                                    >
                                </div>
                            </div>
                        </div>
                    </el-tab-pane>
                </el-tabs>

                <div style="margin: 50px auto;position: absolute;right: 20px" class="page">
                    <el-pagination background layout="prev, pager, next" :total="total" :current-page="recordParams.pagination" :page-size="recordParams.PageSize" @current-change="RpageChange">
                    </el-pagination>
                </div>
            </div>
        </div>
    </el-row>
</div>
<script src="/js/api.js"></script>
<script>

    var app = new Vue({
        el: "#app",
        data: {
            equactiveName:"eq-first",
            activeName: 'first',
            addVisible:false,
            currentIndex: 1,
            total:3,
            dialogVisible: false,
            userParams:{
                pagination:1,
                pageSize:10,
            },
            userMod:{},
            equListCopy:[],
            equipmentForm:{
                index:null,
                status: "NOT_USE",
                location: ""
            },
            userData:{},
            recordParams:{
                pagination:1,
                pageSize:10,
            },
            recordMod:{},
            recordData:{},

            equipmentParams:{
                pagination:1,
                pageSize:10,
            },
            equipmentMod:{},
            equipmentData:{},
            userList: [
                {
                    loginName: "滴滴滴",
                    mobile: "15896168017",
                    sex: "女",
                    school: "江苏师范大学",
                    campusCard: "4020171490",
                },
                {
                    loginName: "测试",
                    mobile: "15896168017",
                    sex: "男",
                    school: "江苏师范大学",
                    campusCard: "4020171490",
                },
                {
                    loginName: "刘德华",
                    mobile: "15896168017",
                    sex: "男",
                    school: "江苏师范大学",
                    campusCard: "4020171490",
                },
            ],
            recordList: [
                {
                    id: "1002100214",
                    createTime: "2021-1-25",
                    amount: "4",
                    time: "20mins",
                },
                {
                    id: "1002100215",
                    createTime: "2021-1-23",
                    amount: "2",
                    time: "10mins",
                },
                {
                    id: "1002100213",
                    createTime: "2021-1-24",
                    amount: "4",
                    time: "20mins",
                },
                {
                    id: "1002100218",
                    createTime: "2021-1-26",
                    amount: "3",
                    time: "15mins",
                },
            ],
            equipmentList: [
                {
                    id: "001",
                    location: "泉北浴室",
                    school: "江苏师范大学",
                },
                {
                    id: "002",
                    location: "泉北浴室",
                    school: "江苏师范大学",
                },
                {
                    id: "001",
                    location: "泉南浴室",
                    school: "江苏师范大学",
                },
                {
                    id: "002",
                    location: "泉南浴室",
                    school: "江苏师范大学",
                },
            ],
        },
       async mounted(){
          const userData = await this.getData("/user/list","POST",{pageNum : 1, pageSize : 10});
          if (userData){
              this.userData = userData;
              this.total = userData.totalPages;
              this.userList = userData.content;
              console.log(this.userList);
          }
          const RecordList = await this.getData("/userRecord/list","POST",{pageNum: 1,
              pageSize: 10,});
          this.recordData = await RecordList;
          this.recordList = RecordList.content;
          console.log(RecordList.content);
           const equipmentList = await this.getData("/equipment/list","POST",{
               pagination: 1,
               pageSize: 10
           });
           this.equipmentData = await equipmentList;
           this.equipmentList = equipmentList.content;
           this.equListCopy = userData.content;
           console.log(this.equipmentData);
        },

        computed:{

            DoingRecord:function fil() {
                return this.recordList.filter(e=>e.recordStatus==='DOING');
            },
            DoneRecord:function f() {
                return this.recordList.filter(e=>e.recordStatus==='DONE');
            },
            ErrorRecord:function f1() {
                return this.recordList.filter(e=>e.recordStatus==='ERROR');
            },
            CancelRecord:function f2() {
                return this.recordList.filter(e=>e.recordStatus==='CANCEL');
            },
            DoingEquipment:function fil() {
                return this.equipmentList.filter(e=>e.status==='USEING');
            },
            NOT_USEEquipment:function f1() {
                return this.equipmentList.filter(e=>e.status==='NOT_USE');
            },

            ErrorEquipment:function f2() {
                return this.equipmentList.filter(e=>e.status==='BREAK');
            },

            PreEquipment:function f3() {
                return this.equipmentList.filter(e=>e.status==='CAN_PRE');
            },
            maleEquipment:function f4() {
                return this.equipmentList.filter(e=>e.location==='男');
            },

            femaleEquipment:function f5() {
                return this.equipmentList.filter(e=>e.location==='女');
            },



        },
        methods: {

            type(type){
                if (type==='all'){
                    this.equipmentList =  this.equListCopy;
                    console.log(this.equipmentList)
                } else if (type==='male'){
                    this.equipmentList = this.equListCopy.filter(e=>e.location==='男');
                    console.log(this.equipmentList)
                }
                else if (type==='female'){
                    this.equipmentList = this.equListCopy.filter(e=>e.location==='女');
                    console.log(this.equipmentList)
                }
            },

            handleClick(tab, event) {
                console.log(tab, event);
            },
           async addEquipment(){
              this.addVisible = false;
              const result = await requests("/equipment/add","POST",this.equipmentForm);
              if (result){
                  this.$message({
                      showClose: true,
                      message: '添加成功',
                      type: 'success'
                  });
                  this.equipmentForm.index=null;
                  this.equipmentForm.location="";
              }
            },
            async pageChange(page){
                this.userParams.pagination=page;
               // const result =await this.getInitData();
                const userData = await this.getData("/user/list","POST",this.userParams);
                this.userList = userData.content;
                console.log("pageChange",userData);
                // window.alert(page)
            },
            async RpageChange(page){
                this.recordParams.pagination=page;
                // const result =await this.getInitData();
                const userData = await this.getData("/userRecord/list","POST",this.recordParams);
                this.recordList = userData.content;
                console.log("pageChange",userData);
                // window.alert(page)
            },
            async EpageChange(page){
                this.equipmentParams.pagination=page;
                // const result =await this.getInitData();
                const userData = await this.getData("/equipment/list","POST",this.equipmentParams);
                this.equipmentList = userData.content;

                console.log("pageChange",userData);
                // window.alert(page)
            },
           async getData(url,type,data){
                const result = await requests(url,type,data);
                if (result.data){
                    return  result.data;
                }
            },

            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
           async change(index) {
                this.currentIndex = index;
               if (index==1){

                   this.total = this.userData.totalElements;
               } else if(index ==2){

                   this.total = this.equipmentData.totalElements;
               }else{

                   this.total = this.recordData.totalElements;
               }
            },
           async remove(List, index) {

                if ( this.currentIndex ===1){
                    const reuslt = await requests("/user/del","GET",{userId:List[index].id});
                    console.log(this.userMod)
                } else if(this.currentIndex===2){
                    console.log(List[index]);
                    const result =await requests("/equipment/del","GET",{id:List[index].id})
                    console.log(this.equipmentMod)
                }else{
                    const result = await  requests("/userRecord/del","GET",{id:List[index].id})
                    console.log( this.recordMod)
                };
               List.splice(index,1);
            },
           async modify(index){
                this.dialogVisible = true;
               if ( this.currentIndex ===1){
                   this.userMod = this.userList[index];
                  // const result = await requests("/user/modify","POST",this.userMod)
                   console.log(this.userMod)
               } else if(this.currentIndex===2){
                   this.equipmentMod = this.equipmentList[index];
                  // const result = await requests("/equipment/modify","POST",this.equipmentMod)
                   console.log(this.equipmentMod)
               }else{
                   this.recordMod = this.recordList[index];
                  // const result = await requests("/userRecord/modifiy","POST",this.recordMod)
                   console.log( this.recordMod)
               }

            },
            async submitMod(){
                this.dialogVisible = false;
                if ( this.currentIndex ===1){
                    const result = await requests("/user/modify","POST",this.userMod)
                    console.log(this.userMod)
                } else if(this.currentIndex===2){
                    const result = await requests("/equipment/modify","POST",this.equipmentMod)
                    console.log(this.equipmentMod)
                }else{
                    const result = await requests("/userRecord/modifiy","POST",this.recordMod)
                    console.log( this.recordMod)
                }
            }
        },
    });
</script>
</body>
</html>
